Imports System.Windows.Forms

Public Class frmSelectFields

    Private TableName As String

    Friend Sub New(ByVal _TableName As String, ByVal Caption As String, ByVal Prompt As String)
        InitializeComponent()
        TableName = _TableName
        Text = Caption
        lblPrompt.Text = Prompt
        lstFields.Items.Clear()
        For Each s As String In Project.DB.GetColumnList(TableName)
            With lstFields
                .Items.Add(s)
            End With
        Next
    End Sub

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

End Class
